import Person from "./person"
import Class from "./class"
class Teacher extends Person{
    constructor(id,name,age,klass){
        super(id,name,age);
        this.klass=klass;
    }
    introduce(){
        let introduce;
        if(this.klass!=undefined){
            introduce=super.introduce()+` I am a Teacher. I teach Class ${this.klass.number}.`;
        }
        else{
            introduce=super.introduce()+` I am a Teacher. I teach No Class.`;
        }
        return introduce;
    }
    introduceWith(studentJerry){
        let introduceWith;
        if(this.klass==studentJerry.klass){
            introduceWith=super.introduce()+` I am a Teacher. I teach Jerry.`
        }
        else{
            introduceWith=super.introduce()+` I am a Teacher. I don't teach Jerry.`
        }
        return introduceWith;
    }
}
module.exports = Teacher;

